<template>
    <view class="container">
        <view class="fab" @click="goTo" v-if="type=='index'">
            <image src="@/static/images/icon_shouye_03@2x.png" class="fab-img"></image>
            <view class="fab-text">回首页</view>
        </view>
        <view class="fab" @click="goTo" v-if="type=='user'">
            <image src="@/static/images/icon_wode_03@2x.png" class="fab-img"></image>
            <view class="fab-text">回我的</view>
        </view>
    </view>
</template>

<script setup>
import {
    getCurrentInstance
} from 'vue';

const {
    proxy
} = getCurrentInstance()

defineProps({
    type: {
        type: String,
        default: 'index'
    }
});

const goTo = () => {

    let url = proxy.type=='index'?'/pages/index/index':'/pages/user/user';

    uni.reLaunch({
    	url:url
    })
}
</script>

<style lang="scss" scoped>
.container {
    width: 112rpx;
    height: 80rpx;
    position: fixed;
    left: 0;
    z-index: 9999999999999999;
    background: #333333;
    border-radius: 0rpx 40rpx 40rpx 0rpx;


    /* #ifdef H5 */
    top: 120rpx;
    /* #endif */

    /* #ifdef MP-WEIXIN */
    top: 32rpx;
    /* #endif */
}

.fab {
    padding-right: 20rpx;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;

    .fab-img {
        width: 28rpx;
        height: 28rpx;
        margin-top: 10rpx;
    }

    .fab-text {
        color: #fff;
        font-size: 20rpx;
        height: 20rpx;
        line-height: 20rpx;
        font-weight: 400;
        margin-top: 6px;
    }
}
</style>